<?php

namespace App\Models;

use Dcat\Admin\Models\Administrator;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class TongUserOpera extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'tong_user_opera';

    protected $guarded = [];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function adminInfo(){
        return $this->hasOne(Administrator::class,'id','admin_id');
    }

    public function userInfo(){
        return $this->hasOne(TongUser::class,'id','u_id');
    }


    public function getDescAttribute($value)
    {
        return json_decode($value,true);
    }

}
